package com.orangecy.rulesubscribe.enums;

import lombok.Getter;

import java.util.Objects;

/**
 * @Author : orangeCy.奕
 * @Product : 猎豹养成产品源码
 * @Time : 2021/10/26
 * @Desc :执行类型枚举
 */
public enum  ActuatorTypeEnum {

    BEAN_PROCESSOR(1);

    // 等等 这里定义策略模式好扩展 process 无需改动

    @Getter
    private final Integer type;

    ActuatorTypeEnum(Integer type){
        this.type = type;
    }

    public static ActuatorTypeEnum resolve(Integer type) {
        for(ActuatorTypeEnum typeEnum : ActuatorTypeEnum.values()) {
            if(Objects.equals(typeEnum.getType(),type)) {
                return typeEnum;
            }
        }
        return null;
    }
}